﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CompositionalAudio.Infrastructure
{
    public class StaticTools
    {
        public static Func<byte[], int, double> GetBitToDoubleFunction(int sampleSize)
        {
            Func<byte[],int, double> ExtractSample = null;

            switch (sampleSize)
            {
                case 32:
                    ExtractSample=(b,c)=>{ return (double)BitConverter.ToInt32(b,c); };
                    break;
                case 16:
                    ExtractSample=(b,c)=>{ return (double)BitConverter.ToInt16(b,c); };
                    break;
            }

            return ExtractSample;
        }
    }
}
